<template>
  <div>
    <!-- 面包屑 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/welcome' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>权限列表</el-breadcrumb-item>
      <el-breadcrumb-item>权限等级</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card>
      <el-table :data="rightslist" border stripe>
        <el-table-column type="index"></el-table-column>
        <el-table-column label="权限名称" prop="authName"></el-table-column>
        <el-table-column label="路径" prop="path"></el-table-column>
        <el-table-column label="权限等级" prop="level">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.level === '0'">一级</el-tag>
            <el-tag v-if="scope.row.level === '1'" type="success">二级</el-tag>
            <el-tag v-if="scope.row.level === '2'" type="warning">三级</el-tag>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
export default {
  name: "Rights",
  data() {
    return {
      rightslist: [
        {
          id: 101,
          authName: "商品管理",
          level: "0",
          pid: 0,
          path: "goods",
        },
        {
          id: 102,
          authName: "订单管理",
          level: "1",
          pid: 0,
          path: "orders",
        },
        {
          id: 103,
          authName: "权限管理",
          level: "2",
          pid: 0,
          path: "rights",
        },
        {
          id: 104,
          authName: "商品列表",
          level: "0",
          pid: 0,
          path: "goods",
        },
        {
          id: 105,
          authName: "添加商品",
          level: "1",
          pid: 0,
          path: "goods",
        },
        {
          id: 106,
          authName: "订单列表",
          level: "2",
          pid: 0,
          path: "orders",
        },
        {
          id: 107,
          authName: "添加订单",
          level: "0",
          pid: 0,
          path: "orders",
        },
        {
          id: 108,
          authName: "用户列表",
          level: "1",
          pid: 0,
          path: "users",
        },
        {
          id: 109,
          authName: "商品管理",
          level: "2",
          pid: 0,
          path: "goods",
        },
        {
          id: 110,
          authName: "订单管理",
          level: "0",
          pid: 0,
          path: "orders",
        },
        {
          id: 111,
          authName: "商品管理",
          level: "1",
          pid: 0,
          path: "goods",
        },
        {
          id: 112,
          authName: "订单管理",
          level: "2",
          pid: 0,
          path: "orders",
        },
      ],
    };
  },
};
</script>

<style>
</style>